﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="PhonesDetails.aspx.vb" Inherits="APhones2.PhonesDetails" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
    .style1
    {
        font-size: x-large;
    }
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <p>
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            DataKeyNames="ID" DataSourceID="SqlDataSource1">
            <Columns>
                <asp:BoundField DataField="BrandName" HeaderText="BrandName" 
                    SortExpression="BrandName" />
                <asp:BoundField DataField="PhoneName" HeaderText="PhoneName" 
                    SortExpression="PhoneName" />
                <asp:BoundField DataField="PhoneVersion" HeaderText="PhoneVersion" 
                    SortExpression="PhoneVersion" />
                <asp:BoundField DataField="DateRelease" HeaderText="DateRelease" 
                    SortExpression="DateRelease" />
                <asp:BoundField DataField="Review" HeaderText="Review" 
                    SortExpression="Review" />
                <asp:ImageField DataImageUrlField="Picture" HeaderText="Picture">
                    <ControlStyle Height="100px" Width="100px" />
                </asp:ImageField>
                <asp:HyperLinkField HeaderText="Brand Name" />
                <asp:HyperLinkField DataNavigateUrlFields="ID" 
                    DataNavigateUrlFormatString="Ratings.aspx?ID={0}" HeaderText="Rating" 
                    Text="Rate this Phone" />
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:Phones %>" 
            ProviderName="<%$ ConnectionStrings:Phones.ProviderName %>" 
            SelectCommand="SELECT * FROM [Phones] WHERE ([ID] = ?)">
            <SelectParameters>
                <asp:QueryStringParameter Name="ID" QueryStringField="ID" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
        <br />
    </p>
<p class="style1">
        <strong>Comments by other Users on this phone</strong></p>
    <p>
        <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" Width="335px" 
           >
            <Columns>
                <asp:BoundField DataField="UserName" HeaderText="UserName" 
                    SortExpression="UserName" />
                <asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />
                <asp:BoundField DataField="Body" HeaderText="Body" SortExpression="Body" 
                    HtmlEncode="False" HtmlEncodeFormatString="False" />
            </Columns>
        </asp:GridView>
        <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
        </asp:ToolkitScriptManager>
    </p>
    <p>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
            ConnectionString="<%$ ConnectionStrings:Phones %>" 
            ProviderName="<%$ ConnectionStrings:Phones.ProviderName %>" 
            SelectCommand="SELECT [UserName], [Title], [Body] FROM [Comments] WHERE ([Phone_fkid] = ?)">
            <SelectParameters>
                <asp:QueryStringParameter Name="Phone_fkid" QueryStringField="ID" 
                    Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
    </p>
<p class="style1">
        <strong>Please Make your comment about this phone here</strong></p>
    <p>
       Comment Title: <asp:TextBox ID="tb_CommentTitle" runat="server"></asp:TextBox>
    </p>
    <p>
        Comment Body: 
        <asp:TextBox ID="tb_CommentBody" runat="server" Height="100px" 
            Width="375px" TextMode="MultiLine"></asp:TextBox>
        <asp:HtmlEditorExtender ID="tb_CommentBody_HtmlEditorExtender" runat="server" 
            Enabled="True" TargetControlID="tb_CommentBody">
        </asp:HtmlEditorExtender>
    </p>
<p>
        <asp:Button ID="Button1" runat="server" Text="Button" />
    </p>
    <p>
        <asp:Label ID="lb_Comment" runat="server"></asp:Label>
    </p>
    <p>
        <asp:GridView ID="GridView3" runat="server" AutoGenerateColumns="False" 
            DataSourceID="SqlDataSource3">
            <Columns>
                <asp:BoundField DataField="TagName" HeaderText="TagName" 
                    SortExpression="TagName" />
                <asp:BoundField DataField="PhoneName" HeaderText="PhoneName" 
                    SortExpression="PhoneName" />
                <asp:BoundField DataField="Picture" HeaderText="Picture" 
                    SortExpression="Picture" />
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
            ConnectionString="<%$ ConnectionStrings:Phones %>" 
            ProviderName="<%$ ConnectionStrings:Phones.ProviderName %>" 
            SelectCommand="SELECT * FROM [TagsQuery] WHERE ([TagName] = ?)">
            <SelectParameters>
                <asp:QueryStringParameter Name="TagName" QueryStringField="ID" Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>
    </p>
    <p>
        &nbsp;</p>
    </asp:Content>
